/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_condicion_diagnostico")
@NamedQueries({
    @NamedQuery(name = "CexCondicionDiagnostico.findAll", query = "SELECT c FROM CexCondicionDiagnostico c")})
public class CexCondicionDiagnostico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ccd_id")
    private Integer ccdId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 64)
    @Column(name = "ccd_nombre")
    private String ccdNombre;
    @Column(name = "ccd_codigo")
    private Integer ccdCodigo;
    @OneToMany(mappedBy = "cexCondicionDiagnostico", fetch = FetchType.LAZY)
    private List<CexDiagnosticoConsulta> cexDiagnosticoConsultaList;

    public CexCondicionDiagnostico() {
    }

    public CexCondicionDiagnostico(Integer ccdId) {
        this.ccdId = ccdId;
    }

    public CexCondicionDiagnostico(Integer ccdId, String ccdNombre) {
        this.ccdId = ccdId;
        this.ccdNombre = ccdNombre;
    }

    public Integer getCcdId() {
        return ccdId;
    }

    public void setCcdId(Integer ccdId) {
        this.ccdId = ccdId;
    }

    public String getCcdNombre() {
        return ccdNombre;
    }

    public void setCcdNombre(String ccdNombre) {
        this.ccdNombre = ccdNombre;
    }

    public Integer getCcdCodigo() {
        return ccdCodigo;
    }

    public void setCcdCodigo(Integer ccdCodigo) {
        this.ccdCodigo = ccdCodigo;
    }

    public List<CexDiagnosticoConsulta> getCexDiagnosticoConsultaList() {
        return cexDiagnosticoConsultaList;
    }

    public void setCexDiagnosticoConsultaList(List<CexDiagnosticoConsulta> cexDiagnosticoConsultaList) {
        this.cexDiagnosticoConsultaList = cexDiagnosticoConsultaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ccdId != null ? ccdId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexCondicionDiagnostico)) {
            return false;
        }
        CexCondicionDiagnostico other = (CexCondicionDiagnostico) object;
        if ((this.ccdId == null && other.ccdId != null) || (this.ccdId != null && !this.ccdId.equals(other.ccdId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.CexCondicionDiagnostico[ ccdId=" + ccdId + " ]";
    }
    
}
